package com.fesine.jms.producer;

import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @description: 启动生产者
 * @author: Fesine
 * @createTime:2017/9/3 15:35
 * @update:修改内容
 * @author: Fesine
 * @updateTime:2017/9/3 15:35
 */
public class AppProducer {
    public static void main(String[] args) {
        //获取配置文件
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("producer.xml");
        ProducerService producerService = context.getBean(ProducerService.class);

        for (int i = 0; i < 100; i++) {
            producerService.sendMessage("test"+i);
        }
        //关闭连接
        context.close();
    }
}
